#include "WPILib.h"
#include "Basket.h"
#include "MatedVictor.h"
#include "ShooterEncoder.h"

#ifndef SHOOTER_H
#define SHOOTER_H

class Shooter
{
	// The flywheel shoots the ball.
	MatedVictor* 	flywheel;
	PIDController* 	flywheelPID;
	
	// The infrared break switch detects the flywheel RPMs.
	ShooterEncoder* irbreak;
	
	SmartDashboard* dashboard;

	static const float RPM_PER_MPS;

public:
	
	Shooter(
		int flywheelChannel1,  
		int flywheelChannel2,
		int irbreakChannel
	); 
	
	~Shooter();
	
	void EnablePIDs(bool value);

	// The speed of the flywheel.
	float GetSpeed();
	void SetRawSpeed(float value);
	void SetSpeed(float value);
	
	// Returns true if the PID is on target.
	bool UpToSpeed();
	
	// Determines optimal speed, given distance and target.
	float ShootTo(float distance);
	
	//Updates the state of the shooter (namely, updates shooterEncoder)
	void Update();
	void Print();
	float GetTargetSpeed();
};

#endif
